package com.sidom.movieIndexer.domain;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import com.sidom.movieIndexer.domain.file.MovieFile;
import com.sidom.movieIndexer.domain.google.GoogleSearchResult;
import com.sidom.movieIndexer.domain.imdb.ImdbResult;

/**
 * A class representing a Movie indexer movie.
 *
 * @author Siebe
 */
public class Movie {
	/**
	 * {@link MovieFile} information about the {@link Movie}.
	 */
	private MovieFile movieFile;
	/**
	 * {@link GoogleSearchResult} information about the {@link Movie}.
	 */
	private GoogleSearchResult googleSearchResult;
	/**
	 * {@link ImdbResult} information about the {@link Movie}.
	 */
	private ImdbResult imdbResult;
	
	/**
	 * @return the movieFile
	 */
	public MovieFile getMovieFile() {
		return movieFile;
	}

	/**
	 * @param movieFile the movieFile to set
	 */
	public void setMovieFile(final MovieFile movieFile) {
		this.movieFile = movieFile;
	}

	/**
	 * @return the google
	 */
	public GoogleSearchResult getGoogleSearchResult() {
		return googleSearchResult;
	}

	/**
	 * @param google the google to set
	 */
	public void setGoogleSearchResult(final GoogleSearchResult googleSearchResult) {
		this.googleSearchResult = googleSearchResult;
	}

	/**
	 * @return the imdb
	 */
	public ImdbResult getImdbResult() {
		return imdbResult;
	}

	/**
	 * @param imdb the imdb to set
	 */
	public void setImdbResult(final ImdbResult imdbResult) {
		this.imdbResult = imdbResult;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public final boolean equals(final Object obj) {
		if(obj==this){
			return true;
		}
		if(!(obj instanceof Movie)){
			return false;
		}
		Movie movieToCheck = (Movie)obj;
		return EqualsBuilder.reflectionEquals(this, movieToCheck);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public final String toString() {
		return ReflectionToStringBuilder.toString(this);
	}
}
